<?php

    function create_thumbnail($photoname, $w, $h, $thumbname, $gallery, $gen, $URL_RELATIVE) {

        $gallery.='/';

        $gen->set_jpeg_quality(100);
        $gen->setImagesFolder($URL_RELATIVE . $gallery);
        $gen->thumbnail($photoname, $w, $h, $URL_RELATIVE . $gallery . 'thumbnails/' . $thumbname);
    }

?>